<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Hello React!</title>
<!-- react 核心库 -->
<script src="https://cdn.staticfile.org/react/16.4.0/umd/react.development.js"></script>
<!-- dom相关库 -->
<script src="https://cdn.staticfile.org/react-dom/16.4.0/umd/react-dom.development.js"></script>
<!-- Es6->Es5 jsx->js -->
<script src="https://cdn.staticfile.org/babel-standalone/6.26.0/babel.min.js"></script>
</head>
<body>
 
<div id="example"></div>
<!-- 使用JSX，属性使用text/babel -->
<script type="text/babel">

const data = ['Angular', 'React', 'Vue']
const data2 = [<li>Angular</li>, <li>React</li>, <li>Vue</li>]

// 创建虚拟DOM
const element = (
    <div>
        <h1>前端框架列表</h1>
        <ul>
            {
                data.map((item,index)=>{
                    return (
                        <li key={index}>{item}</li>
                    )
                })
            }    
        </ul>
    </div>
);
// 渲染虚拟DOM到页面
ReactDOM.render(element, document.getElementById('example'));
</script>
 
</body>
</html>